import axiosInstance from '@/tools/request'
import type { GeneratorTemplate } from '@/api/generator/generator'


export const templateAdd = (template: GeneratorTemplate) => {
  return axiosInstance({
    url: `/generator/template`,
    method: 'post',
    data: template
  })
}
export const templateRemove = (templateId: number) => {
  return axiosInstance({
    url: `/generator/template/${templateId}`,
    method: 'delete'
  })
}


export const templateModify = (template: GeneratorTemplate) => {
  return axiosInstance({
    url: `/generator/template`,
    method: 'put',
    data: template
  })
}
export const templateList = (template: GeneratorTemplate, params: any) => {
  return axiosInstance({
    url: '/generator/template/list',
    method: 'post',
    params: params,
    data: template
  })
}
//通过ID
export const templateById = (templateId: number) => {
  return axiosInstance({
    url: `/generator/template/${templateId}`,
    method: 'get'
  })
}
